var MongoClient = require("mongodb").MongoClient;

var callbackErrHandle = function(err,inserted){
    if(err) return console.dir(err);
    console.log("inserted = " + inserted);
}

MongoClient.connect("mongodb://localhost:27017/exampleDB",function(err,db){
    if(err)	return console.dir(err);

    var collection = db.collection("test");
    var doc1 = {"hello":"doc1"};
    var doc2 = {"hello":"doc2"};
    var lotsOfDocs = [{'hello':'doc3'},{'hello':'doc4'}];

    collection.insert(doc1,callbackErrHandle);
    collection.insert(doc2,{w:1},callbackErrHandle);
    collection.insert(lotsOfDocs,{w:1},callbackErrHandle);
});

console.log("All Done");
